package com.jhsw.roadsun.module.business.controller.app.expressage.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import static com.jhsw.roadsun.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "APP - 寄件信息 Response VO")
@Data
public class AppExpressageSimpleRespVO {

    @Schema(description = "寄件ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9001")
    private Long id;

    @Schema(description = "运单号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String orderNo;

    @Schema(description = "收件国家", requiredMode = Schema.RequiredMode.REQUIRED)
    private String country;

    @Schema(description = "运输方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    private String shippingType;

    @Schema(description = "是否报关（0否 1是）")
    private Boolean customsFiling;

    @Schema(description = "货物种类", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer goodsCls;

    @Schema(description = "货物总数", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long goodsCount;

    @Schema(description = "货物总值", requiredMode = Schema.RequiredMode.REQUIRED)
    private BigDecimal goodsTotalPrice;

    @Schema(description = "付款方式（0寄付 1到付 2第三方结款）（字典：business_expressage_pay_method）", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer payMethod;

    @Schema(description = "审核状态（0未处理 1已出单 2已取消）（字典：business_expressage_audit_status）", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    private Integer auditStatus;

    @Schema(description = "下单时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime createTime;
}
